/*
2021-11-9
https://leetcode-cn.com/problems/vowels-of-all-substrings/
*/
class Solution {
public:
    long long countVowels(string word) {
        long long ans = 0;
        int n=word.size();
        unordered_set<char> S{'a','e','i','o','u'};
        for(int i=0;i<n;i++)
        {
            if(S.count(word[i]))
            {
                ans+=(long long)(n-i)*(long long)(i+1);
            }
        }
        return ans;
    }
};
